/*
 * Copyright (c) 2009 Johnny Mast
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

#import <Foundation/Foundation.h>
#import "GameEngine.h"

@class Texture2D;

@interface Resources : NSObject {
	NSMutableDictionary     *_cachedTextures;
	NSInteger activeblinkers;
	NSInteger activespriteSheetTextures;
	XFUint    currentFramesPerSecond;
}
+(Resources*) SharedResourceManager;

@property(nonatomic, assign)   NSInteger activeblinkers;
@property(nonatomic, assign)   NSInteger activespriteSheetTextures;
@property(nonatomic, assign)   XFUint    currentFramesPerSecond;



-(UIInterfaceOrientation)getCurrentDeviceOriontation;

// Selector returns a Texture2D which has a ket of |aTextureName|.  If a texture cannot be
// found with that key then a new Texture2D is created and added to the cache and a 
// reference to this new Texture2D instance is returned.
- (Texture2D*)getTextureWithName:(NSString*)aTextureName;

- (BOOL)hasTextureWithName:(NSString*)name;

// Selector that releases a cached texture which has a matching key to |aTextureName|.
- (BOOL)releaseTextureWithName:(NSString*)aTextureName;

// Externaly add an image as texture with kkey
-(void)setTextureImageWithName:(NSString*)Texturename textureImage:(UIImage*)textureImage;

// Selector that releases all cached textures.
- (void)releaseAllTextures;

// Increase the number of active blinkers
-(void)increaseActiveblinkers;
-(void)increaseActiveSpriteSheetTextures;
@end
